import http from '@/utils/request'

/**
 *
 * @param {*} page  第几页/页码
 * @param {*} pagesize 每页
 * @returns
 */
export const reqGetRoleList = (page, pagesize = 10) => http({
  method: 'GET',
  url: '/sys/role',
  params: {
    page,
    pagesize
  }
})

/**
 *
 * @param {*} id 删除角色
 *
 *
 */
export const reqDelRole = id => http({
  method: 'DELETE',
  url: `/sys/role/${id}`

})

/**
 *
 * @param {*} 添加角色
 *
 *
 */
export const reqAddRole = form => http({
  method: 'POST',
  url: '/sys/role/',
  data: form

})

/**
 *
 * @param {*} data 编辑用户信息
 *
 */
export const reqUpdateRole = data => http({
  method: 'PUT',
  url: `/sys/role/${data.id}`,
  data

})

/**
 *
 * @param {*} id 根据id获取用户详情，用于回显
 *
 */
export const reqGetRoleDetail = id => http({
  method: 'GET',
  url: `/sys/role/${id}`

})
